/**
 * Copyright (C) 2018-2021
 * All rights reserved, Designed By www.yixiang.co

 */
package co.yixiang.modules.activity.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
* @author hupeng
* @date 2020-05-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@TableName("yx_store_visit")
public class YxStoreVisit implements Serializable {

    @TableId
    private Long id;


    /** 产品ID */
    private Long productId;


    /** 产品类型 */
    private String productType;


    /** 产品分类ID */
    private Integer cateId;


    /** 产品类型 */
    private String type;


    /** 用户ID */
    private Long uid;


    /** 访问次数 */
    private Integer count;


    /** 备注描述 */
    private String content;


    /** 添加时间 */
    @TableField(fill= FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Integer addTime;

    public static YxStoreVisitBuilder builder() {
        return new YxStoreVisitBuilder();
    }


    public void copy(YxStoreVisit source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public static class YxStoreVisitBuilder {
        private Long id;
        private Long productId;
        private String productType;
        private Integer cateId;
        private String type;
        private Long uid;
        private Integer count;
        private String content;
        private Integer addTime;

        YxStoreVisitBuilder() {
        }

        public YxStoreVisitBuilder id(Long id) {
            this.id = id;
            return this;
        }

        public YxStoreVisitBuilder productId(Long productId) {
            this.productId = productId;
            return this;
        }

        public YxStoreVisitBuilder productType(String productType) {
            this.productType = productType;
            return this;
        }

        public YxStoreVisitBuilder cateId(Integer cateId) {
            this.cateId = cateId;
            return this;
        }

        public YxStoreVisitBuilder type(String type) {
            this.type = type;
            return this;
        }

        public YxStoreVisitBuilder uid(Long uid) {
            this.uid = uid;
            return this;
        }

        public YxStoreVisitBuilder count(Integer count) {
            this.count = count;
            return this;
        }

        public YxStoreVisitBuilder content(String content) {
            this.content = content;
            return this;
        }

        public YxStoreVisitBuilder addTime(Integer addTime) {
            this.addTime = addTime;
            return this;
        }

        public YxStoreVisit build() {
            return new YxStoreVisit(id, productId, productType, cateId, type, uid, count, content, addTime);
        }

        public String toString() {
            return "YxStoreVisit.YxStoreVisitBuilder(id=" + this.id + ", productId=" + this.productId + ", productType=" + this.productType + ", cateId=" + this.cateId + ", type=" + this.type + ", uid=" + this.uid + ", count=" + this.count + ", content=" + this.content + ", addTime=" + this.addTime + ")";
        }
    }
}
